Optimal. Leaf size=64 \[ -\frac{a \cot ^3(c+d x)}{3 d}-\frac{i a \cot ^2(c+d x)}{2 d}+\frac{a \cot (c+d x)}{d}-\frac{i a \log (\sin (c+d x))}{d}+a x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.089368, antiderivative size = 64, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 3, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.136, Rules used = {3529, 3531, 3475} \[ -\frac{a \cot ^3(c+d x)}{3 d}-\frac{i a \cot ^2(c+d x)}{2 d}+\frac{a \cot (c+d x)}{d}-\frac{i a \log (\sin (c+d x))}{d}+a x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3529
Rule 3531
Rule 3475
Rubi steps
\begin{align*} \int \cot ^4(c+d x) (a+i a \tan (c+d x)) \, dx &=-\frac{a \cot ^3(c+d x)}{3 d}+\int \cot ^3(c+d x) (i a-a \tan (c+d x)) \, dx\\ &=-\frac{i a \cot ^2(c+d x)}{2 d}-\frac{a \cot ^3(c+d x)}{3 d}+\int \cot ^2(c+d x) (-a-i a \tan (c+d x)) \, dx\\ &=\frac{a \cot (c+d x)}{d}-\frac{i a \cot ^2(c+d x)}{2 d}-\frac{a \cot ^3(c+d x)}{3 d}+\int \cot (c+d x) (-i a+a \tan (c+d x)) \, dx\\ &=a x+\frac{a \cot (c+d x)}{d}-\frac{i a \cot ^2(c+d x)}{2 d}-\frac{a \cot ^3(c+d x)}{3 d}-(i a) \int \cot (c+d x) \, dx\\ &=a x+\frac{a \cot (c+d x)}{d}-\frac{i a \cot ^2(c+d x)}{2 d}-\frac{a \cot ^3(c+d x)}{3 d}-\frac{i a \log (\sin (c+d x))}{d}\\ \end{align*}
Mathematica [C] time = 0.196879, size = 72, normalized size = 1.12 \[ -\frac{a \cot ^3(c+d x) \, _2F_1\left (-\frac{3}{2},1;-\frac{1}{2};-\tan ^2(c+d x)\right )}{3 d}-\frac{i a \left (\cot ^2(c+d x)+2 \log (\tan (c+d x))+2 \log (\cos (c+d x))\right )}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.041, size = 65, normalized size = 1. \begin{align*}{\frac{-{\frac{i}{2}}a \left ( \cot \left ( dx+c \right ) \right ) ^{2}}{d}}-{\frac{ia\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}}-{\frac{a \left ( \cot \left ( dx+c \right ) \right ) ^{3}}{3\,d}}+{\frac{\cot \left ( dx+c \right ) a}{d}}+ax+{\frac{ac}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 2.05202, size = 96, normalized size = 1.5 \begin{align*} \frac{6 \,{\left (d x + c\right )} a + 3 i \, a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 6 i \, a \log \left (\tan \left (d x + c\right )\right ) + \frac{6 \, a \tan \left (d x + c\right )^{2} - 3 i \, a \tan \left (d x + c\right ) - 2 \, a}{\tan \left (d x + c\right )^{3}}}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.13836, size = 371, normalized size = 5.8 \begin{align*} \frac{18 i \, a e^{\left (4 i \, d x + 4 i \, c\right )} - 18 i \, a e^{\left (2 i \, d x + 2 i \, c\right )} +{\left (-3 i \, a e^{\left (6 i \, d x + 6 i \, c\right )} + 9 i \, a e^{\left (4 i \, d x + 4 i \, c\right )} - 9 i \, a e^{\left (2 i \, d x + 2 i \, c\right )} + 3 i \, a\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right ) + 8 i \, a}{3 \,{\left (d e^{\left (6 i \, d x + 6 i \, c\right )} - 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 3.14458, size = 133, normalized size = 2.08 \begin{align*} - \frac{i a \log{\left (e^{2 i d x} - e^{- 2 i c} \right )}}{d} + \frac{\frac{6 i a e^{- 2 i c} e^{4 i d x}}{d} - \frac{6 i a e^{- 4 i c} e^{2 i d x}}{d} + \frac{8 i a e^{- 6 i c}}{3 d}}{e^{6 i d x} - 3 e^{- 2 i c} e^{4 i d x} + 3 e^{- 4 i c} e^{2 i d x} - e^{- 6 i c}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.28155, size = 174, normalized size = 2.72 \begin{align*} \frac{a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 3 i \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 48 i \, a \log \left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + i\right ) - 24 i \, a \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) - 15 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - \frac{-44 i \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 15 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 3 i \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + a}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3}}}{24 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]